package net.colah.k1.core;

import org.openkoala.koala.commons.domain.KoalaAbstractEntity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Created by sinclair on 4/27/14.
 */
@Entity
@Table(name = "BO_PRODUCT")
public class Product extends KoalaAbstractEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7333233629710830321L;

	private Supplier supplier;

	private String name;
	private String code;
	private String desc;
	private String spec;

	private String unit;
	private BigDecimal cost;
	private BigDecimal price;

	@Override
	public String[] businessKeys() {
		return new String[0];
	}

	@ManyToOne
	@JoinColumn(name = "SUPPLIER_ID")
	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	@Column(name = "NAME", length = 64, nullable = false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "CODE", length = 48, nullable = true)
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "DESCRIPTION", length = 128, nullable = true)
	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	@Column(name = "SPEC", length = 64, nullable = true)
	public String getSpec() {
		return spec;
	}

	public void setSpec(String spec) {
		this.spec = spec;
	}

	@Column(name = "UNIT", length = 24, nullable = true)
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Column(name = "COST", precision = 12, scale = 2)
	public BigDecimal getCost() {
		return cost;
	}

	public void setCost(BigDecimal cost) {
		this.cost = cost;
	}

	@Column(name = "PRICE", precision = 12, scale = 2)
	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

}
